<template>
    <div>
        <!-- 榜单管理-昌热 2018年7月13日18:08:00 john -->

        <Row>
            <i-col span="24">
                <Tabs v-model="currentTab.index" @on-click="switchTab">
                    <template v-for="item in tabList">
                        <TabPane :label="item.label" :name="item.val"></TabPane>
                    </template>
                </Tabs>
                <tablePage ref="inspectionTab"  :api="getChangreBandanByPage" :param="queryParam"
                           sort-name="id"
                           sort-type="desc" :isStartLoad="true" v-if="currentTab.index==tabList[0].val">
                    <template slot-scope="props">
                        <Table :columns="columnList" :data="props.data" @on-sort-change="props.sortChange"
                               border></Table>
                    </template>
                </tablePage>

            </i-col>
        </Row>
    </div>
</template>

<script>
  import tablePage from '@components/table/tablePage.vue'
  import {
    getChangreBandanByPage
  } from '@api/backEnd/bangDan'
  // import moment from 'moment'

  export default {
    name: 'ChangreBangdan',
    data () {
      let tabList = [
        {label: '榜单列表', val: '1'}
      ]
      let currentTab = {index: '1'}
      let queryParam = {}
      let columnList = [
        {
          title: '标识',
          key: 'id',
          width: 100
          // fixed: 'left'
        },
        {
          title: '车牌号',
          key: 'ch',
          width: 100
        },
        {
          title: '货名',
          key: 'hm',
          width: 100
        },
        // {
        //   title: '起始站出发时间',
        //   width: 150,
        //   key: 'startStationTime',
        //   sortable: true,
        //   render: (h, params) => {
        //     let thisdata = params.row.startStationTime
        //     return (<span>{thisdata ? moment(thisdata).format('YYYY-MM-DD HH:mm') : ''}</span>)
        //   }
        // },
        // {
        //   title: '到达终点站时间',
        //   width: 150,
        //   key: 'endStationTime',
        //   sortable: true,
        //   render: (h, params) => {
        //     let thisdata = params.row.endStationTime
        //     return (<span>{thisdata ? moment(thisdata).format('YYYY-MM-DD HH:mm') : ''}</span>)
        //   }
        // },
        {
          title: '规格',
          ellipsis: 'false',
          key: 'gg',
          width: 80
        },
        {
          title: '发货单位',
          ellipsis: 'false',
          key: 'fhdw',
          width: 200
        },
        {
          title: '收货单位',
          ellipsis: 'false',
          key: 'shdw',
          width: 100
        },
        {
          title: '运输单位',
          ellipsis: 'false',
          key: 'ysdw',
          width: 100
        },
        {
          title: '矿发毛重',
          ellipsis: 'false',
          key: 'kfmz',
          width: 100
        },
        {
          title: '矿发净重',
          ellipsis: 'false',
          key: 'kfjz',
          width: 100
        },
        {
          title: '备注',
          ellipsis: 'false',
          key: 'bz',
          width: 200
        },
        {
          title: '毛重',
          ellipsis: 'false',
          key: 'mz',
          width: 100
        },
        {
          title: '皮重',
          ellipsis: 'false',
          key: 'pz',
          width: 100
        },
        {
          title: '扣矸',
          key: 'kg',
          width: 50
        },
        {
          title: '扣水',
          key: 'ks',
          width: 50
        },
        {
          title: '净重',
          key: 'jz',
          width: 100
        },
        {
          title: '毛重差值',
          ellipsis: 'false',
          key: 'mzcz',
          width: 100
        },
        {
          title: '皮重差值',
          ellipsis: 'false',
          key: 'pzcz',
          width: 100
        },
        {
          title: '净重差值',
          ellipsis: 'false',
          key: 'jzcz',
          width: 100
        },
        {
          title: '毛重时间',
          key: 'mzsj',
          width: 150
        },
        {
          title: '皮重时间',
          key: 'pzsj',
          width: 150
        },
        {
          title: '毛重司榜员',
          ellipsis: 'false',
          key: 'mzsby',
          width: 100
        },
        {
          title: '皮重司磅员',
          ellipsis: 'false',
          key: 'pzsby',
          width: 150
        },
        {
          title: '皮重磅号',
          ellipsis: 'false',
          key: 'pzbh',
          width: 100
        },
        {
          title: '作废',
          ellipsis: 'false',
          key: 'zf',
          width: 50
        },
        {
          title: '上传',
          ellipsis: 'false',
          key: 'sc',
          width: 50
        },
        {
          title: '车辆自重',
          ellipsis: 'false',
          key: 'zlzz',
          width: 100
        },
        {
          title: '煤场',
          key: 'mc',
          width: 100
        },
        {
          title: '区域',
          ellipsis: 'false',
          key: 'qw',
          width: 50
        },
        {
          title: '段位',
          ellipsis: 'false',
          key: 'dw',
          width: 50
        },
        {
          title: '箱号',
          key: 'xh',
          width: 100
        },
        {
          title: '扣重',
          ellipsis: 'false',
          key: 'kz',
          width: 50
        }
      ]
      let datas = {
        tabList,
        currentTab,
        queryParam,
        columnList,
        getChangreBandanByPage
      }
      return datas
    },
    computed: {},
    watch: { },
    created () {},
    methods: {
      switchTab () {
        // this.queryParam.like = ''
        // if (this.currentTab.index === 1) {
        //   this.lableName = '车队'
        //   this.selectList = this.fleetSelectList
        // }
        // this.$nextTick(() => {
        //   // this.dataRefresh()
        // })
      }
    },
    mounted () {
    },
    components: {
      tablePage
    }
  }
</script>

<style scoped>

</style>
